#include <iostream>

std::size_t hash(const std::string& input, std::size_t begin, std::size_t end);

void part1(const std::string& input)
{
    std::size_t sum {0};

    // Split with ','
    std::size_t begin {0};
    while (begin < input.size())
    {
        if (input[begin] == ',') 
        {
            begin += 1;
            continue;
        }
        // input[begin] is not a ',', find next ',' or end
        std::size_t end {begin + 1};
        while (true)
        {
            if (end >= input.size() || input[end] == ',')
                break;
            end += 1;
        }

        // input[begin, end) is not ','
        sum += hash(input, begin, end);
        begin = end + 1;
    }
    std::cout << sum << std::endl;
}